﻿#region Using Statements
using System;
using System.Collections.Generic;
using DirectZZT.Shared.Core;
#endregion

namespace DirectZZT.Shared.Scripting.ScriptLanguages
{
    /// <summary>
    /// Implements the <see cref="IScript"/> interface to provide the logic for a Powerscript script.
    /// A powerscript script is way more powerful (hence the name) than a ZZT-oop.
    /// Is not completely different and not in the least compatible with ZZT-oop, but has lots of its flaws ironed out.
    /// </summary>
    [Serializable()]
    [Export("Powerscript", Type = typeof(IScript))]
    public sealed class PowerscriptScript : IScript
    {
        #region Static Fields

        private static Dictionary<string, Action<ZZTOopScript, string>> METHODSCACHE;

        #endregion

        #region Fields

        private ScriptState _state;
        private Dictionary<string, string> _variables;

        #endregion

        #region Constructors
        
        /// <summary>
        /// Initializes a new instance of the PowerscriptScript class.
        /// </summary>
        public PowerscriptScript()
        {
            _state = ScriptState.Unstarted;
            _variables = new Dictionary<string, string>();
        }

        #endregion

        #region IScript Members

        /// <summary>
        /// The script.
        /// </summary>
        public string[] Script { get; set; }
        /// <summary>
        /// Gets/sets the line which is currently executing.
        /// </summary>
        public int CurrentInstruction { get; set; }

        ScriptLanguage IScript.Language
        {
            get { return ScriptLanguage.Powerscript; }
        }

        ScriptState IScript.State
        {
            get { return _state; }
        }

        void IScript.OnSend(string eventName)
        {

        }

        void IScript.Stop()
        {
            _state = ScriptState.Finished;
        }

        void IScript.OnAttach(IScriptHost scriptHost)
        {

        }

        void IScript.OnDetach(IScriptHost scriptHost)
        {

        }

        void IScript.Initialize()
        {

        }

        void IScript.Update()
        {

        }

        #endregion

        #region IDebuggableScript Members

        string IDebuggableScript.DebugName
        {
            get { return ""; }
        }

        void IDebuggableScript.DebugBreak()
        {

        }

        void IDebuggableScript.DebugContinue()
        {

        }

        void IDebuggableScript.DebugStep()
        {

        }

        void IDebuggableScript.DebugRestart()
        {

        }

        void IDebuggableScript.DebugMoveToLine(int line)
        {

        }

        void IDebuggableScript.DebugModifyLineContents(int line, string scriptLine)
        {

        }

        #endregion
    }
}
